package com.godme.structure;

public class RBN {
    private int key;
    private boolean isBlack;
    private RBN left;
    private RBN right;
    private RBN parent;

    public RBN(int key) {
        this.key = key;
        this.isBlack = false;
    }

    public int getKey() {
        return key;
    }

    public boolean isBlack() {
        return isBlack;
    }

    public RBN getLeft() {
        return left;
    }

    public RBN getRight() {
        return right;
    }

    public RBN getParent() {
        return parent;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public void setBlack(boolean black) {
        isBlack = black;
    }

    public void setLeft(RBN left) {
        this.left = left;
    }

    public void setRight(RBN right) {
        this.right = right;
    }

    public void setParent(RBN parent) {
        this.parent = parent;
    }

    @
            Override
    public String toString() {
        return "RBN{" +
                "key=" + key +
                ", color=" + (isBlack == true ? "BLACK" : "RED") +
                '}';
    }
}
